import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
testCase="DBshop022_删除品牌流程"
firefox=openBrowser(url)
firefox.get(urlAdmin)
DBshopLoginAdmin(firefox)
# 进入商品管理商品品牌二级菜单
DBshopEnterMenu2(firefox,'商品管理','商品品牌')
# 1.点击“删除”按钮，确定删除，删除成功。
firefox.find_element_by_xpath("//td[contains(.,'苹果')]/following-sibling::td[4]/a[2]").click()
firefox.switch_to.alert.accept()
firefox.refresh()
try:
    firefox.find_element_by_xpath("//td[contains(.,'苹果')]")
    writeLog("%s 测试失败"%testCase)
    getPhoto(firefox)
except:
    writeLog("%s 测试通过" % testCase)
firefox.quit()